﻿using System;
using System.IO;

namespace CI.Utils
{
    /// <summary>
    /// managers folders
    /// </summary>
    public static class ResourceFolders
    {
        /// <summary>
        /// User resource folder will be MyDocuments\Mesopotamia Experiment
        /// </summary>
        /// <returns></returns>
        public static string UsersResourceFolder()
        {
            // folder name
            string folderName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Mesopotamia Experiment");

            // make sure the folder exists, if not create it
            if (!Directory.Exists(folderName))
            {
                Directory.CreateDirectory(folderName);
                SimEnv.Instance.TraceLogger.LogDebug(string.Format("Created Directory {0}", folderName));
            }

            // return the folder name
            return folderName.ToLower();
        }
    }
}


